package com.jinrong.controller;/*

 */

import com.jinrong.common.Result;
import com.jinrong.entity.User;
import com.jinrong.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @projectName: ShowYourLove
 * @package: com.jinrong.controller
 * @className: UserController
 * @author: JackVictor
 * @description: TODO
 * @date: 2024/3/23 12:06
 * @version: 1.0
 */
@Slf4j
@CrossOrigin
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;
    @PostMapping("/register")
    public Result register(@RequestBody User user){
        log.info("register user: " + user);
        userService.save(user);
        log.info("register user success");
        return new Result().success(user);
    }
}

